#pragma once

#include "../Core/Vector.h"
#include "DrawAutomaticUniform.h"
#include "Uniform.h"
#include "Context.h"
#include "DrawCommand.h"
#include "SceneState.h"

using namespace Core;

namespace Renderer
{
	class PerspectiveNearPlaneDistanceUniform : public DrawAutomaticUniform
	{
	public:
		PerspectiveNearPlaneDistanceUniform(Uniform* uniform)
		{
			_uniform = (TemplateUniform<float>*)uniform;
		}

		void Set(Context* context, DrawCommand* drawCommand, SceneState* sceneState)
		{
			_uniform->SetValue((float)(sceneState->GetCamera()->PerspectiveNearPlaneDistance()));
		}

	private:
		TemplateUniform<float>* _uniform;
	};
}